package com.linkage.lcims.base.po.business;

import java.io.Serializable;
import java.util.Set;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;


/** 
 *        @hibernate.class
 *         table="BD_ATTR_CODE"
 *     
*/
@SuppressWarnings("serial")
public class BdAttrCode implements Serializable {

    /** identifier field */
    private Integer attrid;

    /** persistent field */
    private String attrname;

    /** persistent field */
    private Integer attrtype;

    /** nullable persistent field */
    private String description;

    /** persistent field */
    private Set<BdGroupAccessAttr> bdGroupAccessAttrs;

    /** persistent field */
    private Set<BdGroupAuthen> bdGroupAuthens;

    /** persistent field */
    private Set<BdServiceAttr> bdServiceAttrs;

    /** persistent field */
    private Set<BdGroupAuthor> bdGroupAuthors;

    /** full constructor */
    public BdAttrCode(Integer attrid, String attrname, Integer attrtype, String description, Set<BdGroupAccessAttr> bdGroupAccessAttrs, Set<BdGroupAuthen> bdGroupAuthens, Set<BdServiceAttr> bdServiceAttrs, Set<BdGroupAuthor> bdGroupAuthors) {
        this.attrid = attrid;
        this.attrname = attrname;
        this.attrtype = attrtype;
        this.description = description;
        this.bdGroupAccessAttrs = bdGroupAccessAttrs;
        this.bdGroupAuthens = bdGroupAuthens;
        this.bdServiceAttrs = bdServiceAttrs;
        this.bdGroupAuthors = bdGroupAuthors;
    }

    /** default constructor */
    public BdAttrCode() {
    }

    /** minimal constructor */
    public BdAttrCode(Integer attrid, String attrname, Integer attrtype, Set<BdGroupAccessAttr> bdGroupAccessAttrs, Set<BdGroupAuthen> bdGroupAuthens, Set<BdServiceAttr> bdServiceAttrs, Set<BdGroupAuthor> bdGroupAuthors) {
        this.attrid = attrid;
        this.attrname = attrname;
        this.attrtype = attrtype;
        this.bdGroupAccessAttrs = bdGroupAccessAttrs;
        this.bdGroupAuthens = bdGroupAuthens;
        this.bdServiceAttrs = bdServiceAttrs;
        this.bdGroupAuthors = bdGroupAuthors;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.Integer"
     *             column="attrid"
     *         
     */
    public Integer getAttrid() {
        return this.attrid;
    }

    public void setAttrid(Integer attrid) {
        this.attrid = attrid;
    }

    /** 
     *            @hibernate.property
     *             column="attrname"
     *             length="50"
     *             not-null="true"
     *         
     */
    public String getAttrname() {
        return this.attrname;
    }

    public void setAttrname(String attrname) {
        this.attrname = attrname;
    }

    /** 
     *            @hibernate.property
     *             column="attrtype"
     *             length="10"
     *             not-null="true"
     *         
     */
    public Integer getAttrtype() {
        return this.attrtype;
    }

    public void setAttrtype(Integer attrtype) {
        this.attrtype = attrtype;
    }

    /** 
     *            @hibernate.property
     *             column="description"
     *             length="100"
     *         
     */
    public String getDescription() {
        return this.description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="attrid"
     *            @hibernate.collection-one-to-many
     *             class="com.linkage.lcbms.po.business.BdGroupAccessAttr"
     *         
     */
    public Set<BdGroupAccessAttr> getBdGroupAccessAttrs() {
        return this.bdGroupAccessAttrs;
    }

    public void setBdGroupAccessAttrs(Set<BdGroupAccessAttr> bdGroupAccessAttrs) {
        this.bdGroupAccessAttrs = bdGroupAccessAttrs;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="attrid"
     *            @hibernate.collection-one-to-many
     *             class="com.linkage.lcbms.po.business.BdGroupAuthen"
     *         
     */
    public Set<BdGroupAuthen> getBdGroupAuthens() {
        return this.bdGroupAuthens;
    }

    public void setBdGroupAuthens(Set<BdGroupAuthen> bdGroupAuthens) {
        this.bdGroupAuthens = bdGroupAuthens;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="attrid"
     *            @hibernate.collection-one-to-many
     *             class="com.linkage.lcbms.po.business.BdServiceAttr"
     *         
     */
    public Set<BdServiceAttr> getBdServiceAttrs() {
        return this.bdServiceAttrs;
    }

    public void setBdServiceAttrs(Set<BdServiceAttr> bdServiceAttrs) {
        this.bdServiceAttrs = bdServiceAttrs;
    }

    /** 
     *            @hibernate.set
     *             lazy="true"
     *             inverse="true"
     *             cascade="none"
     *            @hibernate.collection-key
     *             column="attrid"
     *            @hibernate.collection-one-to-many
     *             class="com.linkage.lcbms.po.business.BdGroupAuthor"
     *         
     */
    public Set<BdGroupAuthor> getBdGroupAuthors() {
        return this.bdGroupAuthors;
    }

    public void setBdGroupAuthors(Set<BdGroupAuthor> bdGroupAuthors) {
        this.bdGroupAuthors = bdGroupAuthors;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("attrid", getAttrid())
            .toString();
    }

    public boolean equals(Object other) {
        if ( (this == other ) ) return true;
        if ( !(other instanceof BdAttrCode) ) return false;
        BdAttrCode castOther = (BdAttrCode) other;
        return new EqualsBuilder()
            .append(this.getAttrid(), castOther.getAttrid())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getAttrid())
            .toHashCode();
    }

}
